//
//  MoreButtonView.h
//  
//
//  Created by 尤振宇 on 16/9/23.
//
//

#import <UIKit/UIKit.h>
@class MoreButtonView;

@protocol MoreButtonViewDelegate <NSObject>

@optional
/**
 *
 *
 *  @param index            点击的button Index
 *  @param title            点击的button title
 *  @param sameIndex        是否是同一个
 */
-(void)touchUpInsideButtonActionIndex:(NSInteger)index title:(NSString *)title sameIndex:(BOOL)sameIndex;

-(void)lineAnimateDidEnd:(MoreButtonView *)moreView;

@end

@interface MoreButtonView : UIView

@property(nonatomic,assign)id<MoreButtonViewDelegate> moreButtonViewDelegate;

@property(nonatomic,strong)UIScrollView *scrollView;

@property(nonatomic,assign)int buttonCount;
@property(nonatomic,strong)UIColor *lineColor;
@property(nonatomic,strong)UIColor *titleColor;
@property(nonatomic,strong)UIColor *selectedTitleColor;
@property(nonatomic,assign)CGFloat buttonW; // 不设置将现有的按个数均分
@property(nonatomic,assign)CGFloat lineW;   // 不设置  lineW = buttonW
@property(nonatomic,assign)CGFloat lineH;   // 不设置  lineH = 0;
@property(nonatomic,assign)CGFloat lineYOffset;  //line 负数向上

@property(nonatomic,strong)UIImage *backImage;
@property(nonatomic,strong)UIImage *selectedbackImage;

@property(nonatomic,weak)UIView *lineView;


@property(nonatomic,assign)BOOL lineWEqualTitleW;

-(UIButton *)buttonWithIndex:(int)index;
-(void)moveLine:(UIButton *)button;
-(void)setTitles:(NSArray <NSString *>*)titles;
@end
